# Dict 键值对，无序，用大括号
if __name__ == '__main__':
    sampleDict = {'Amy': 28, 'Mike': 65, 'Tom': '男人'}
    # 修改
    sampleDict['Amy'] = 77
    # 插入
    sampleDict['Dog'] = '狗叔'
    # 删除
    sampleDict.pop('Tom')
    # 查询 × 2
    print(sampleDict['Amy'])
    print(sampleDict.get('Amy'))
    # 是否存在
    print('Mike' in sampleDict)
    # 遍历循环
    for k, v in sampleDict.items():
        print(k, '=', v)

    # Set，key不重复，无序
    sampleSet = set([1, 2, 2, 3, 3, 3, 4])
    print(sampleSet)
    # 插入
    sampleSet.add(5)
    # 删除
    sampleSet.remove(1)
    print(sampleSet)

    aSet = {1, 2}
    bSet = {2, 3}
    # 交集
    print(aSet & bSet)
    # 并集
    print(aSet | bSet)
